﻿<div class="scene-setting-component">
    <div class="setting-bg" ng-click="$parent.sceneSetting.showFlag = false">
    </div>
    <div class="scene-setting-info fade">
        <div class="alert alert-warning" role="alert" ng-if="invalidText">
            {{invalidText}}
        </div>
        <form class="form-horizontal" role="form" name="myForm" novalidate>
            <div class="share-scene clearfix">
                <div class="title">
                    <h2 title="分享设置">
                        分享设置
                        <a ng-click="saveSceneSettings(scene)" class="btn-main save" ng-disabled="!pageSceneObj">
                            确定
                        </a>
                    </h2>
                </div>
                <div class="content">
                    <div class="setting-share corner clearfix">
                        <input name="name" type="text" maxlength="40" class="form-control name"
                               id="name" placeholder="默认为微信分享的产品名称" ng-model="pageSceneObj.name" stop-input-propagation>
                        <div class="clearfix">
                            <div class="pull-left cover-img hint--right hint--rounded" data-hint="封面尺寸 220*226">
                                <a ng-click="openImageModal()">
                                    <img style="width:75px; height:75px;" ng-if="!pageSceneObj.image.imgSrc"
                                         ng-src="{{PREFIX_FILE_HOST+'img/fm_mr.jpg'}}" />
                                    <img style="width:75px; height:75px;" ng-if="pageSceneObj.image.imgSrc"
                                         ng-src="{{PREFIX_FILE_HOST+pageSceneObj.image.imgSrc}}" />
                                    <em>
                                        更换封面
                                    </em>
                                </a>
                            </div>
                            <div class="description-wrapper">
                                <textarea ng-model="pageSceneObj.description" class="description form-control"
                                          rows="2" name="description" ng-change="maxLength30()" placeholder="你可以写下30字以下的描述,该描述默认为微信分享的产品名称"
                                          stop-input-propagation></textarea>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="basic-setting">
                <div class="title">
                    <h2 title="产品设置">
                        产品设置
                    </h2>
                </div>
                <div class="content container-fluid">
                    <div class="row">
                        <div class="col-xs-6">
                            <label for="page_mode" class="setting-label">
                                翻页方式
                            </label>
                            <select ng-model="pageSceneObj.pageMode" ng-options="pagemode.id as pagemode.name for pagemode in pagemodes"
                                    id="page_mode" class="form-control"></select>
                        </div>
                        <div class="col-xs-6">
                            <div class="auto-flip">
                                <span class="flip-loop hidden">
                                    <input type="checkbox" />
                                    循环
                                </span>
                                <input id="autoFlip" type="checkbox" ng-model="pageSceneObj.propertyObj.autoFlip"
                                       ng-change="onAutoFlipChange(pageSceneObj.propertyObj.autoFlip)" />
                                <label for="autoFlip">
                                    自动翻页
                                </label>
                                <select ng-show="pageSceneObj.propertyObj.autoFlip" ng-model="pageSceneObj.propertyObj.autoFlipTime"
                                        ng-options="autoFlipTime.id as autoFlipTime.name for autoFlipTime in autoFlipTimes"
                                        class="form-control flip-speed" style="padding:6px 10px;"></select>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-6">
                            <label for="type" class="setting-label">
                                产品类型
                            </label>
                            <select ng-model="pageSceneObj.type" ng-options="sceneproduct.id as sceneproduct.tradeName for sceneproduct in product"
                                    id="type" class="scene-type form-control"></select>
                        </div>
                        <div class="col-xs-6">
                            <label for="trade" class="setting-label">
                                行业类别
                            </label>
                            <select ng-model="pageSceneObj.trade" ng-options="scenetrade.id as scenetrade.tradeName for scenetrade in trade"
                                    id="trade" class="scene-type form-control"></select>
                        </div>
                    </div>
                    <div>
                        <label for="remarks" class="setting-label">
                            产品备注
                        </label>
                        <input id="remarks" placeholder="备注信息用于区分同类产品的差异, 填写后会在【我的场景】中显示" type="text"
                               class="form-control remark" ng-model="pageSceneObj.remarks" />
                    </div>
                    <div class="setting-group setting-music hidden">
                        <label for="type" class="setting-label">
                            场景音乐
                        </label>
                        <div class="setting-value">
                            <span class="form-control bg-music" ng-click="openAudioModal()">
                                {{(!!tpl.obj.scene.bgAudio) ? "已添加" : "未添加"}}
                            </span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="setting-spread">
                <div class="title" ng-click="sceneSettingTabs.showSpreadSetting = !sceneSettingTabs.showSpreadSetting">
                    <h2 class="title">
                        申请推广
                    </h2>
                    <span class="fa" ng-class="{'fa-chevron-circle-down': !sceneSettingTabs.showSpreadSetting, 'fa-chevron-circle-up': sceneSettingTabs.showSpreadSetting}">
                    </span>
                </div>
                <div class="content" ng-show="sceneSettingTabs.showSpreadSetting">
                    <div class="select-option">
                        <input id="showGround" type="checkbox" class="option" ng-model="pageSceneObj.examineStateObj.status"
                               ng-disabled="pageSceneObj.examineStateObj.test">
                        <label for="showGround" class="option-name">
                            申请入驻案例中心或模版中心
                            <span class="option-tips" ng-switch="pageSceneObj.examineStateObj.status">
                                <span class="not-yet" ng-switch-default>
                                    未申请
                                </span>
                                <span class="in-progress" ng-switch-when="true">
                                    {{pageSceneObj.examineStateObj.test?pageSceneObj.examineStateObj.test:'申请中'}}
                                </span>
                            </span>
                        </label>
                    </div>
                    <div class="select-option" ng-if="pageSceneObj.designerCertStautsObj.permissions">
                        <input id="show7ke" type="checkbox" class="option" ng-model="pageSceneObj.designerCertStautsObj.status"
                               ng-disabled="pageSceneObj.designerCertStautsObj.test">
                        <label for="show7ke" class="option-name">
                            申请入驻7客联盟案例
                            <span class="option-tips" ng-switch="pageSceneObj.designerCertStautsObj.status">
                                <span class="not-yet" ng-switch-default>
                                    未申请
                                </span>
                                <span class="in-progress" ng-switch-when="true">
                                    {{pageSceneObj.designerCertStautsObj.test?pageSceneObj.designerCertStautsObj.test:'申请中'}}
                                </span>
                            </span>
                        </label>
                    </div>
                </div>
            </div>
            <div class="setting-challenge" ng-if="match">
                <div class="title" ng-click="sceneSettingTabs.showChallengeSetting = !sceneSettingTabs.showChallengeSetting">
                    <h2 class="title">
                        参加赛事
                    </h2>
                    <span class="fa" ng-class="{'fa-chevron-circle-down': !sceneSettingTabs.showChallengeSetting, 'fa-chevron-circle-up': sceneSettingTabs.showChallengeSetting}">
                    </span>
                </div>
                <div class="content" ng-show="sceneSettingTabs.showChallengeSetting">
                    <div class="select-option" ng-repeat="m in pageSceneObj.match">
                        <input type="checkbox" class="option" ng-model="m.status" ng-disabled="m.hasJoined">
                        <label class="option-name hint--right hint-round" data-hint="点击查看赛事详情">
                            <a href="{{m.url}}" target="_blank">
                                {{m.name}}
                            </a>
                        </label>
                    </div>
                </div>
            </div>
            <div>
                <div class="title" ng-click="sceneSettingTabs.showCopyrightSetting = !sceneSettingTabs.showCopyrightSetting">
                    <h2 class="title">
                        版权定制
                    </h2>
                    <span class="fa" ng-class="{'fa-chevron-circle-down': !sceneSettingTabs.showCopyrightSetting, 'fa-chevron-circle-up': sceneSettingTabs.showCopyrightSetting}">
                    </span>
                </div>
                <div class="content" ng-show="sceneSettingTabs.showCopyrightSetting">
                    <div class="select-option">
                        <input id="hideCopyright" type="checkbox" class="option" ng-model="pageSceneObj.copyright.opencopr"
                               ng-disabled="pageSceneObj.copyright.number <= 0 || pageSceneObj.copyright.hasOpened">
                        <label for="hideCopyright" class="option-name">
                            申请取消本场景70度版权信息，本次取消版权将消耗您100枚7币
                            <a href="http://bbs.70c.com/forum.php?mod=viewthread&tid=5862" target="_blank"
                               class="btn btn-link">
                                获取7币
                            </a>
                        </label>
                        <p>
                            您还拥有 {{pageSceneObj.copyright.number}} 枚7币，成功申请后您的7币数量将递减，该操作无法恢复
                        </p>
                    </div>
                </div>
            </div>
            <div class="setting-qrcode">
                <div class="title" ng-click="sceneSettingTabs.showQrcodeSetting = !sceneSettingTabs.showQrcodeSetting">
                    <h2 class="title">
                        二维码美化
                    </h2>
                    <span class="fa" ng-class="{'fa-chevron-circle-down': !sceneSettingTabs.showQrcodeSetting, 'fa-chevron-circle-up': sceneSettingTabs.showQrcodeSetting}">
                    </span>
                </div>
                <div class="content container-fluid" ng-show="sceneSettingTabs.showQrcodeSetting">
                    <div class="row">
                        <div class="col-xs-6">
                            <div qrcode url="{{pageSceneObj.url}}" qrcode-width="140" qrcode-height="140">
                            </div>
                            <p>
                                现在扫一扫马上分享给朋友圈
                            </p>
                        </div>
                        <div class="col-xs-6">
                            <a class="qrcode-custom" ng-href="/index/appqrcode?sceneid={{sceneId}}"
                               target="_blank">
                                <img ng-src="{{CLIENT_RES_CDN}}img/ht02.png" />
                                <span>
                                    二维码美化
                                </span>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </form>
        <div class="setting-operations">
            <a ng-click="cancelSceneSetting()" class="btn-grey0 cancel">
                取消
            </a>
            <a ng-click="saveSceneSettings(scene)" style="margin-left: 30px;" class="btn-main save"
               ng-disabled="!pageSceneObj">
                确定
            </a>
        </div>
    </div>
</div>